bhd-components 0.10.39 → 0.10.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2965,6 +2965,11 @@ var handleRenderSyntaxBlock = function(markdownContent, flag) {
2965
2965
  return markdownContent;
2966
2966
  }
2967
2967
  };
2968
+ // 去掉think
2969
+ var replaceThinkAndYaml = function() {
2970
+ var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
2971
+ return text.replace(/```(\s)?yaml(?:.|\n)*?```/ig, "").replace(/<thinking>([\s\S]*?)<\/thinking>/g, "").replace(RegExp('<div\\s+class="think-block">.*?<\\/div>', "gs"), "").replace(/^[ \n]+/g, "");
2972
+ };
2968
2973
 
2969
2974
  var HistoryFun = function(props) {
2970
2975
  var type = props.type; props.roomId; var userData = props.userData, http = props.http, urllocation = props.urllocation, onClose = props.onClose, loadSpecifiedData = props.loadSpecifiedData;
@@ -3514,7 +3519,7 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
3514
3519
  }),
3515
3520
  /*#__PURE__*/ jsx("p", {
3516
3521
  className: modules_63b47c51$f.con,
3517
- children: contactsList.length > 0 && contactsList[0].lastMsg
3522
+ children: contactsList.length > 0 && replaceThinkAndYaml(contactsList[0].lastMsg)
3518
3523
  })
3519
3524
  ]
3520
3525
  })
@@ -3560,7 +3565,7 @@ var ContactsList = /*#__PURE__*/ forwardRef(function(props, ref) {
3560
3565
  }),
3561
3566
  /*#__PURE__*/ jsx("p", {
3562
3567
  className: modules_63b47c51$f.con,
3563
- children: item.lastMsg
3568
+ children: replaceThinkAndYaml(item.lastMsg)
3564
3569
  })
3565
3570
  ]
3566
3571
  })
@@ -8216,11 +8221,6 @@ function escapeHtml(str) {
8216
8221
  return str;
8217
8222
  }
8218
8223
  var exactRegex = /class\s*=\s*["']think-block["']/;
8219
- // 去掉think
8220
- var replaceThinkAndYaml = function() {
8221
- var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
8222
- return text.replace(/```(\s)?yaml(?:.|\n)*?```/ig, "").replace(/<thinking>([\s\S]*?)<\/thinking>/g, "").replace(RegExp('<div\\s+class="think-block">.*?<\\/div>', "gs"), "").replace(/^[ \n]+/g, "");
8223
- };
8224
8224
  r.initialize({
8225
8225
  startOnLoad: false,
8226
8226
  theme: "default",
@@ -9668,6 +9668,7 @@ var CustomerService = function(props) {
9668
9668
  //识别的内容
9669
9669
  // console.log("eventSource msg: ", event.data);
9670
9670
  var msg = JSON.parse(event.data);
9671
+ console.log("tempMessageId", tempMessageId);
9671
9672
  msg.tempMessageId = tempMessageId;
9672
9673
  if (msg.message) {
9673
9674
  // if (!hasYamlStarted && msg.message && /```\s*yaml/.test(content)) {
@@ -10016,7 +10017,11 @@ var CustomerService = function(props) {
10016
10017
  }).then(function(res) {
10017
10018
  var newHistoryMessageList = [];
10018
10019
  if (res.data.messages.length > 0) {
10019
- var dataList = res.data.messages.reverse();
10020
+ var dataList = res.data.messages.reverse().map(function(x) {
10021
+ return _object_spread_props(_object_spread({}, x), {
10022
+ messageId: x.id
10023
+ });
10024
+ });
10020
10025
  var originList = 0;
10021
10026
  var newList = 0;
10022
10027
  setHistoryMessageList(function(historyMessageList) {
@@ -11423,7 +11428,7 @@ var CustomerService = function(props) {
11423
11428
  /*#__PURE__*/ jsx("i", {
11424
11429
  className: "Frame427319094 ".concat(item.upvoted ? styles.active : ""),
11425
11430
  onClick: function() {
11426
- likeMessage(item.id, item.upvoted, item.id);
11431
+ likeMessage(item.messageId, item.upvoted, item.id);
11427
11432
  //老师的聊天窗口中不需要点赞和踩消息
11428
11433
  if (!isAiChatWindow) return;
11429
11434
  //只有最后一条回答,支持发送点赞或踩
@@ -11431,7 +11436,7 @@ var CustomerService = function(props) {
11431
11436
  if (!item.extraInfo && item.sender == "AI") {
11432
11437
  aiSendQuestions(1, {
11433
11438
  roomId: roomId,
11434
- message: "\x03\x03\x03你给出的答案我非常满意,赞!\x03\x03\x03",
11439
+ message: " 你给出的答案我非常满意,赞! \\",
11435
11440
  quotedMessage: "",
11436
11441
  regenerate: false,
11437
11442
  generateUpvoteOrDownvoteMessage: true
@@ -11446,7 +11451,7 @@ var CustomerService = function(props) {
11446
11451
  /*#__PURE__*/ jsx("i", {
11447
11452
  className: "Frame427319095 ".concat(item.downvoted ? styles.active : ""),
11448
11453
  onClick: function() {
11449
- disagreeMessage(item.id, item.downvoted, item.id);
11454
+ disagreeMessage(item.messageId, item.downvoted, item.id);
11450
11455
  //老师的聊天窗口中不需要点赞和踩消息
11451
11456
  if (!isAiChatWindow) return;
11452
11457
  //只有最后一条回答,支持发送点赞或踩
@@ -11454,7 +11459,7 @@ var CustomerService = function(props) {
11454
11459
  if (!item.extraInfo && item.sender == "AI") {
11455
11460
  aiSendQuestions(1, {
11456
11461
  roomId: roomId,
11457
- message: "\x03\x03\x03你给出的答案很糟糕,我不满意,踩!\x03\x03\x03",
11462
+ message: " 你给出的答案很糟糕,我不满意,踩! \\",
11458
11463
  quotedMessage: "",
11459
11464
  regenerate: false,
11460
11465
  generateUpvoteOrDownvoteMessage: true
@@ -11638,7 +11643,7 @@ var CustomerService = function(props) {
11638
11643
  if (!item.extraInfo && item.sender == "AI") {
11639
11644
  aiSendQuestions(1, {
11640
11645
  roomId: roomId,
11641
- message: "\x03\x03\x03你给出的答案我非常满意,赞!\x03\x03\x03",
11646
+ message: " 你给出的答案我非常满意,赞! \\",
11642
11647
  quotedMessage: "",
11643
11648
  regenerate: false,
11644
11649
  generateUpvoteOrDownvoteMessage: true
@@ -11665,7 +11670,7 @@ var CustomerService = function(props) {
11665
11670
  //AI回答
11666
11671
  aiSendQuestions(1, {
11667
11672
  roomId: roomId,
11668
- message: "\x03\x03\x03你给出的答案很糟糕,我不满意,踩!\x03\x03\x03",
11673
+ message: " 你给出的答案很糟糕,我不满意,踩! \\",
11669
11674
  quotedMessage: "",
11670
11675
  regenerate: false,
11671
11676
  generateUpvoteOrDownvoteMessage: true